﻿<%@ Assembly Name="MII_FIF, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f02eab3637bedb94" %>
<%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %>
<%@ Register TagPrefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Register Src="../../../../_controltemplates/15/MII_FIF/Header.ascx" TagPrefix="UC" TagName="Header" %>
<%@ Register Src="../../../../_controltemplates/15/MII_FIF/LeftMenu.ascx" TagPrefix="UC" TagName="LeftMenu" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="FormNetworkDevice.aspx.cs" Inherits="MII_FIF.Layouts.MII_FIF.FormNetworkDevice" DynamicMasterPageFile="~masterurl/default.master" %>

<asp:Content ID="PageHead" ContentPlaceHolderID="PlaceHolderAdditionalPageHead" runat="server">
    <link href="../JQuery/jquery-ui-1.10.3.custom/css/ui-lightness/jquery-ui-1.10.3.custom.min.css" rel="stylesheet" />
    <link href="../Style.css" rel="stylesheet" type="text/css" />
</asp:Content>

<asp:Content ID="Main" ContentPlaceHolderID="PlaceHolderMain" runat="server">    
    <script src="../JQuery/jquery-ui-1.10.3.custom/js/jquery-1.9.1.js" type="text/javascript"></script>
    <script src="../JQuery/jquery-ui-1.10.3.custom/js/jquery-ui-1.10.3.custom.min.js" type="text/javascript"></script>
    <script src="../JQuery/jquery-ui-1.10.3.custom/js/jquery.numeric.js" type="text/javascript"></script>
    <script type="text/javascript">
        function NumberOnlyInit() {
            $(".numeric").numeric();
            $(".integer").numeric(false, function () { alert("Integers only"); this.value = ""; this.focus(); });
            $(".positive").numeric({ negative: false }, function () { alert("No negative values"); this.value = ""; this.focus(); });
            $(".positive-integer").numeric({ decimal: false, negative: false }, function () { alert("Positive integers only"); this.value = ""; this.focus(); });
            $("#remove").click(
                    function (e) {
                        e.preventDefault();
                        $(".numeric,.integer,.positive").removeNumeric();
                    }
            );
        }

        function CheckTheCheckBoxes(dename) {
            var deid = "";
            var elem = document.forms[0].elements;
            for (var i = 0; i < elem.length; i++) {
                if (elem[i].name != null) {
                    if (elem[i].name.indexOf(dename) != -1) {
                        if (elem[i].disabled == false) {
                            elem[i].checked = document.getElementById('chkSelectAll').checked;
                        }
                    }
                }
            }
            return deid;
        }

        $(function () {
            NumberOnlyInit();
        });
    </script>
    <asp:Panel ID="Panel1" runat="server" DefaultButton="btnSubmit">
        <table class="TableLuar">
            <tr>
                <td class="LeftMenu">
                    <UC:LeftMenu runat="server" id="LeftMenu" />
                </td>
                <td style="vertical-align: top;">
                    <table class="TableDalam">
                        <tr>
                            <td colspan="4">
                                <UC:Header runat="server" ID="Header"></UC:Header>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="4">
                                <h2 style="font-weight:bold">
                                    Network Device
                                </h2>
                            </td>
                        </tr>
                        <tr>
                            <td class="KolomKiri">Inventory By</td>
                            <td colspan="3">
                                <asp:Label runat="server" ID="lblInventoryBy" />
                            </td>                      
                        </tr>
                        <tr>
                            <td class="KolomKiri">Rack Number</td>
                            <td>
                                <asp:DropDownList runat="server" ID="ddlRackNumber" />
                                <asp:Label runat="server" CssClass="errorMsg" Text="*"/>
                                <asp:RequiredFieldValidator ID="rfvRackNumber" InitialValue="-1" Display="Dynamic" runat="server" ControlToValidate="ddlRackNumber" ErrorMessage="Please select rack number" CssClass="errorMsg" SetFocusOnError="true"/>
                            </td>
                            <td class="kolomKanan">Label Name</td>
                            <td>
                                <asp:TextBox runat="server" ID="txtLabelName"></asp:TextBox>
                                <asp:Label ID="Label1" runat="server" CssClass="errorMsg" Text="*"/>
                                <asp:RequiredFieldValidator ID="rfvLabelName" Display="Dynamic" runat="server" ControlToValidate="txtLabelName" ErrorMessage="Please input label name" CssClass="errorMsg" SetFocusOnError="true"/>
                            </td>
                        </tr>
                        <tr>
                            <td class="KolomKiri">Location</td>
                            <td colspan="3">
                                <asp:DropDownList runat="server" ID="ddlLocation"></asp:DropDownList>
                                <asp:Label ID="Label2" runat="server" CssClass="errorMsg" Text="*"/>
                                <asp:RequiredFieldValidator ID="rfvLocation" InitialValue="-1" Display="Dynamic" runat="server" ControlToValidate="ddlLocation" ErrorMessage="Please select location" CssClass="errorMsg" SetFocusOnError="true"/>
                            </td>
                        </tr>
                        <tr>
                            <td class="KolomKiri">System Class</td>
                            <td colspan="3">
                                <asp:RadioButtonList runat="server" ID="rblSystemClass" RepeatDirection="Horizontal" RepeatLayout="Table" RepeatColumns="4">
                                    <asp:ListItem Text="Router" Value="Router" />
                                    <asp:ListItem Text="Switch" Value="Switch" />
                                    <asp:ListItem Text="Firewall/VPN" Value="Firewall/VPN" />
                                    <asp:ListItem Text="Wireless" Value="Wireless" />
                                    <asp:ListItem Text="Mobile Device" Value="Mobile Device" />
                                    <asp:ListItem Text="Accelerator" Value="Accelerator" />
                                    <asp:ListItem Text="Other" Value="Other" />
                                </asp:RadioButtonList>
                            </td>
                        </tr>
                        <tr>
                            <td class="KolomKiri">Start From</td>
                            <td colspan="3">
                                <asp:DropDownList runat="server" ID="ddlStartFrom">
                                    <asp:ListItem Text="--Please Select--" Value="-1" />
                                    <asp:ListItem Text="1" Value="1" />
                                    <asp:ListItem Text="2" Value="2" />
                                    <asp:ListItem Text="3" Value="3" />
                                    <asp:ListItem Text="4" Value="4" />
                                    <asp:ListItem Text="5" Value="5" />
                                    <asp:ListItem Text="6" Value="6" />
                                    <asp:ListItem Text="7" Value="7" />
                                    <asp:ListItem Text="8" Value="8" />
                                    <asp:ListItem Text="9" Value="9" />
                                    <asp:ListItem Text="10" Value="10" />
                                    <asp:ListItem Text="11" Value="11" />
                                    <asp:ListItem Text="12" Value="12" />
                                    <asp:ListItem Text="13" Value="13" />
                                    <asp:ListItem Text="14" Value="14" />
                                    <asp:ListItem Text="15" Value="15" />
                                    <asp:ListItem Text="16" Value="16" />
                                    <asp:ListItem Text="17" Value="17" />
                                    <asp:ListItem Text="18" Value="18" />
                                    <asp:ListItem Text="19" Value="19" />
                                    <asp:ListItem Text="20" Value="20" />
                                    <asp:ListItem Text="21" Value="21" />
                                    <asp:ListItem Text="22" Value="22" />
                                    <asp:ListItem Text="23" Value="23" />
                                    <asp:ListItem Text="24" Value="24" />
                                    <asp:ListItem Text="25" Value="25" />
                                    <asp:ListItem Text="26" Value="26" />
                                    <asp:ListItem Text="27" Value="27" />
                                    <asp:ListItem Text="28" Value="28" />
                                    <asp:ListItem Text="29" Value="29" />
                                    <asp:ListItem Text="30" Value="30" />
                                    <asp:ListItem Text="31" Value="31" />
                                    <asp:ListItem Text="32" Value="32" />
                                    <asp:ListItem Text="33" Value="33" />
                                    <asp:ListItem Text="34" Value="34" />
                                    <asp:ListItem Text="35" Value="35" />
                                    <asp:ListItem Text="36" Value="36" />
                                    <asp:ListItem Text="37" Value="37" />
                                    <asp:ListItem Text="38" Value="38" />
                                    <asp:ListItem Text="39" Value="39" />
                                    <asp:ListItem Text="40" Value="40" />
                                </asp:DropDownList>
                                <asp:Label runat="server" CssClass="errorMsg" Text="*"/>
                                <asp:RequiredFieldValidator ID="rfvStartFrom" InitialValue="-1" Display="Dynamic" runat="server" ControlToValidate="ddlStartFrom" ErrorMessage="Please select start from" CssClass="errorMsg" SetFocusOnError="true"/>
                            </td>
                        </tr>
                        <tr>
                            <td class="KolomKiri">System Brand</td>
                            <td>
                                <asp:DropDownList runat="server" ID="ddlSystemBrand" OnSelectedIndexChanged="ddlSystemBrand_SelectedIndexChanged" AutoPostBack="true"/>
                                <asp:Label runat="server" CssClass="errorMsg" Text="*"/>
                                <asp:RequiredFieldValidator ID="rfvSystemBrand" InitialValue="-1" Display="Dynamic" runat="server" ControlToValidate="ddlSystemBrand" ErrorMessage="Please select system brand" CssClass="errorMsg" SetFocusOnError="true"/>
                            </td>
                            <td class="KolomKanan">System Type</td>
                            <td>
                                <asp:DropDownList runat="server" ID="ddlSystemType" />
                                <asp:Label runat="server" CssClass="errorMsg" Text="*"/>
                                <asp:RequiredFieldValidator ID="rfvSystemType" InitialValue="-1" Display="Dynamic" runat="server" ControlToValidate="ddlSystemType" ErrorMessage="Please select system type" CssClass="errorMsg" SetFocusOnError="true"/>
                            </td>
                        </tr>
                        <tr>
                            <td class="KolomKiri">IP</td>
                            <td>
                                <asp:TextBox runat="server" ID="txtIP" />
                            </td>
                            <td class="KolomKanan">Host Name</td>
                            <td>
                                <asp:TextBox runat="server" ID="txtHostName" />
                            </td>
                        </tr>
                        <tr>
                            <td colspan="4">
                                <asp:Panel runat="server" ID="pnlHardwareDetail">
                                    <hr />
                                </asp:Panel>
                                <h2>Hardware Detail</h2>
                            </td>
                        </tr>
                        <tr>
                            <td class="KolomKiri">Path Number</td>
                            <td>
                                <asp:TextBox runat="server" ID="txtPathNumber" />
                            </td>
                            <td class="KolomKanan">Serial Number</td>
                            <td>
                                <asp:TextBox runat="server" ID="txtSerialNumber" />
                            </td>
                        </tr>
                        <tr>
                            <td class="KolomKiri">LAN Port</td>
                            <td>
                                <asp:TextBox runat="server" ID="txtLANPort" CssClass="numeric"/>
                            </td>
                            <td class="KolomKanan">WAN Port</td>
                            <td>
                                <asp:TextBox runat="server" ID="txtWANPort" CssClass="numeric"/>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="4">
                                <asp:Panel ID="pnlModulDetail" runat="server" GroupingText="Modul Detail">
                                    <table style="width: 100%;">
                                        <tr>
                                            <td width="190px">Modul Name
                                            </td>
                                            <td>
                                                <asp:TextBox runat="server" ID="txtModulName"></asp:TextBox>
                                            </td>
                                            <td width="190px">Path Number
                                            </td>
                                            <td>
                                                <asp:TextBox runat="server" ID="txtModulPathNumber"></asp:TextBox>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td width="190px">Serial Number
                                            </td>
                                            <td>
                                                <asp:TextBox runat="server" ID="txtModulSerialNumber"></asp:TextBox>
                                            </td>
                                            <td width="190px">Slot Name
                                            </td>
                                            <td>
                                                <asp:TextBox runat="server" ID="txtModulSlotName"></asp:TextBox>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td colspan="4">
                                                <asp:Button runat="server" ID="btnAdd" Text="Add" OnClick="btnAdd_Click" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td colspan="4">
                                                <asp:GridView runat="server" ID="GridModul" AutoGenerateColumns="false" OnPageIndexChanging="GridModul_PageIndexChanging" OnRowUpdating="GridModul_RowUpdating" OnRowCancelingEdit="GridModul_RowCancelingEdit" OnRowEditing="GridModul_RowEditing" CssClass="grid">
                                                    <EmptyDataTemplate>
                                                        Data Kosong
                                                    </EmptyDataTemplate>
                                                    <Columns>
                                                        <asp:TemplateField>
                                                            <HeaderTemplate>
                                                                <input type="checkbox" name="chkSelectAll" id="chkSelectAll" onclick="CheckTheCheckBoxes('chk');" />
                                                            </HeaderTemplate>
                                                            <ItemTemplate>
                                                                <asp:CheckBox runat="server" ID="chk" />
                                                            </ItemTemplate>
                                                        </asp:TemplateField>
                                                        <asp:TemplateField HeaderText="Modul Name">
                                                            <ItemTemplate>
                                                                <asp:TextBox runat="server" ID="lblModulName" Text='<%# Bind("[ModulName]") %>' ReadOnly="true"></asp:TextBox>
                                                            </ItemTemplate>
                                                            <EditItemTemplate>
                                                                <asp:TextBox runat="server" ID="txtModulName" Text='<%# Bind("[ModulName]") %>'></asp:TextBox>
                                                            </EditItemTemplate>
                                                        </asp:TemplateField>
                                                        <asp:TemplateField HeaderText="Path Number">
                                                            <ItemTemplate>
                                                                <asp:TextBox runat="server" ID="lblPathNumber" Text='<%# Bind("[PathNumber]") %>' ReadOnly="true"></asp:TextBox>
                                                            </ItemTemplate>
                                                            <EditItemTemplate>
                                                                <asp:TextBox runat="server" ID="txtModulPathNumber" Text='<%# Bind("[PathNumber]") %>'></asp:TextBox>
                                                            </EditItemTemplate>
                                                        </asp:TemplateField>
                                                        <asp:TemplateField HeaderText="Serial Number">
                                                            <ItemTemplate>
                                                                <asp:TextBox runat="server" ID="lblSerialNumber" Text='<%# Bind("[SerialNumber]") %>' ReadOnly="true"></asp:TextBox>
                                                            </ItemTemplate>
                                                            <EditItemTemplate>
                                                                <asp:TextBox runat="server" ID="txtModulSerialNumber" Text='<%# Bind("[SerialNumber]") %>'></asp:TextBox>
                                                            </EditItemTemplate>
                                                        </asp:TemplateField>
                                                        <asp:TemplateField HeaderText="Slot Name">
                                                            <ItemTemplate>
                                                                <asp:TextBox runat="server" ID="lblSlotName" Text='<%# Bind("[SlotName]") %>' ReadOnly="true"></asp:TextBox>
                                                            </ItemTemplate>
                                                            <EditItemTemplate>
                                                                <asp:TextBox runat="server" ID="txtModulSlotName" Text='<%# Bind("[SlotName]") %>'></asp:TextBox>
                                                            </EditItemTemplate>
                                                        </asp:TemplateField>
                                                        <asp:BoundField DataField="ID" HeaderStyle-CssClass="hidden" ItemStyle-CssClass="hidden"
                                                            FooterStyle-CssClass="hidden" />
                                                        <asp:TemplateField HeaderText="Action">
                                                            <ItemTemplate>
                                                                <asp:Button runat="server" ID="btnEdit" Text="Edit" CommandName="Edit" />
                                                            </ItemTemplate>
                                                            <EditItemTemplate>
                                                                <table>
                                                                    <tr>
                                                                        <td>
                                                                            <asp:Button runat="server" ID="btnSave" Text="Save" CommandName="Update" />
                                                                        </td>
                                                                        <td>
                                                                            <asp:Button runat="server" ID="btncancel" Text="Cancel" CommandName="Cancel" />
                                                                        </td>
                                                                    </tr>
                                                                </table>
                                                            </EditItemTemplate>
                                                        </asp:TemplateField>
                                                    </Columns>
                                                </asp:GridView>
                                                <br />
                                                <br />
                                                <asp:Button runat="server" ID="btnDelete" Text="Delete" OnClick="btnDelete_Click" />
                                            </td>
                                        </tr>                                        
                                    </table>
                                </asp:Panel>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="4">
                                <asp:Panel runat="server" ID="pnlSoftwareDetail">
                                    <hr />
                                </asp:Panel>
                                <h2>Hardware Checklist</h2>
                            </td>
                        </tr>
                        <tr>
                            <td class="KolomKiri">Firmware Version</td>
                            <td colspan="3">
                                <asp:TextBox runat="server" ID="txtFirmwareVersion" />
                            </td>
                        </tr>
                        <tr>
                            <td class="KolomKiri">Notes</td>
                            <td colspan="3">
                                <asp:TextBox runat="server" ID="txtNotes" TextMode="MultiLine" Width="100%" Height="100px"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td class="KolomKiri">Attachment</td>
                            <td colspan="3">
                                <asp:FileUpload runat="server" ID="FUAttachment" />
                                <asp:Label runat="server" ID="lblFileName" />
                                <asp:Button runat="server" ID="btnDownload" Text="Download" OnClientClick="download();" />
                            </td>
                        </tr>
                        <tr>
                            <td colspan="4">
                                <asp:Label runat="server" ID="lblerror" CssClass="errorMsg"></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="4" align="center">
                                <asp:Button runat="server" ID="btnSubmit" Text="Submit" OnClick="btnSubmit_Click" />
                                &nbsp;&nbsp;&nbsp;&nbsp;
                                <asp:Button runat="server" ID="btnCancel" Text="Cancel" OnClick="btnCancel_Click" CausesValidation="false"/>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
    </asp:Panel>
</asp:Content>

<asp:Content ID="PageTitle" ContentPlaceHolderID="PlaceHolderPageTitle" runat="server">
    Form Inventory - Network Device
</asp:Content>

<asp:Content ID="PageTitleInTitleArea" ContentPlaceHolderID="PlaceHolderPageTitleInTitleArea" runat="server">
</asp:Content>
